package com.lyc.dao.imp;

import java.sql.SQLException;
import java.util.List;

import com.lyc.dao.SportsmanInfoDAO;
import com.lyc.dto.SportsmanDto;
import com.lyc.entity.SportsmanInfo;
import com.lyc.util.DBUtil;

/**
 * @Program: medal
 * @Author: YC
 * @Date: 2022/5/5 17:45
 */

public class SportsmanInfoDAOImpl extends DBUtil.BaseDAOImpl<SportsmanInfo> implements SportsmanInfoDAO {

	@Override
	public List<SportsmanDto> selectMap(int index, int len) throws SQLException {
		String sql = "select \r\n"
				+ "a.*,\r\n"
				+ "b.country_name\r\n"
				+ "from sportsman_info a\r\n"
				+ "inner join country_info b\r\n"
				+ "on a.country_code = b.country_code\r\n"
				+ "order by a.sportsman_id desc limit ?,?\r\n";
		return DBUtil.selectList(sql, SportsmanDto.class, index, len);
	}
}
